cli: render OpTracker as plain lines on non-interactive stderr#2421
Closed
dstotijn wants to merge 2 commits into
Closed
cli: render OpTracker as plain lines on non-interactive stderr#2421dstotijn wants to merge 2 commits into
dstotijn wants to merge 2 commits into
Conversation
The build progress UI uses ANSI cursor save/restore for in-place spinner updates, which only works on a TTY. When stderr is piped into mise, a log aggregator, or CI, every 100ms refresh becomes a new line and floods the output. Detect the CLI's stderr TTY state and pass it through to the daemon as a new non_interactive bool on RunRequest, ExecScriptRequest, and ExecSpecRequest. The OpTracker now renders one plain line per state transition (start / done / failed) instead of the spinner when interactive is false.
…active # Conflicts: # internal/optracker/optracker.go # proto/encore/daemon/daemon.pb.go
Member
|
Created #2428 which is this PR but with the protobuf generated using the correct versions. Thanks! |
Author
|
Closing, change is handled in #2428. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Encore's build-progress UI is rendered by
internal/optracker.OpTracker, which uses ANSI cursor save/restore for in-place spinner updates. That works on a TTY, but when stderr is piped —mise run, log aggregators, CI,tee, Docker logs — every 100ms refresh becomes a new line and floods the output.#2423 added a
lineModerendering path toOpTracker(viaNewLineMode(w)) and uses it for the newencore checkcommand. This PR extends that same rendering to the existingencore runandencore execflows when stderr isn't a terminal.Fix
non_interactiveonRunRequest,ExecScriptRequest,ExecSpecRequest. Defaults to false → existing behavior, fully backwards compatible.!term.IsTerminal(int(os.Stderr.Fd())).optracker.NewLineMode(stderr)instead ofoptracker.New(stderr, stream)when the request isnon_interactive.Example non-interactive output:
Alternatives considered
--quietflag /ENCORE_QUIETenv var — rejected. The flooding is an output-format bug, not a verbosity preference; surfacing it as user config asks people to opt out of broken behavior.Test plan
encore runfrom a TTY shows the spinner UI as before.encore run 2>&1 | catproduces line-mode output, no spinner / cursor escapes.encore exec(Go and TS apps).